package cn.bon.common.tool;

import cn.bon.common.bean.JsonResult;
import cn.bon.common.enums.ResultCode;

public class R {
    public static JsonResult success() {
        return new JsonResult(true);
    }

    public static <T> JsonResult<T> success(T data) {
        return new JsonResult<>(true, data);
    }

    public static JsonResult fail() {
        return new JsonResult(false);
    }

    public static JsonResult fail(ResultCode resultEnum) {
        return new JsonResult(false, resultEnum);
    }
    public static JsonResult fail(String e) {
        return new JsonResult(false, e);
    }
}
